/*
 * RecordsSourceBase.java
 *
 * Created on December 26, 2001
 *
 */

package biofilter.sources;

import biofilter.exceptions.InvalidRecordException;
import biofilter.records.Record;

/**
 * Abstract base class for all records files, filters and queues. See
 * Oriented Software Architecture by Buschmann for a discussion of the pipes and
 * filters architecture. See Patterns in Java Vol. 1 by Grand for a discussion of
 * the filter design pattern
 * @author Original author Tom Brettin with many updates over the years.
 */

public abstract class RecordsSourceBase implements RecordsSourceIF {

    /**
     * To get the next Record to be processed. This is what will be returned by the next call
     * to getRecord(). This is a default non-implementation.  It just throws and exception if 
     * this gets called and has not been implemented in the descendant.
     * @return Record - the next record in the queue
     */
    public Record peek() throws InvalidRecordException {
      throw new InvalidRecordException( "Peek has not been implemented in " +
          "the concrete records file");
    }
}
